package com.rf.richfitwheel.admin.sys.controller;

import com.rf.richfitwheel.admin.contants.UrlConstant;
import com.rf.richfitwheel.admin.sys.model.SendEmail;
import com.rf.richfitwheel.admin.sys.service.EmailService;
import com.rf.richfitwheel.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Author MaSiy
 * Date  2022-5-31
 */
@Controller
@RequestMapping(value = UrlConstant.WEB_ADMIN_URL+"/email")
public class EmailController {

    @Autowired
    private EmailService emailService;

    /**
     * 发送邮件公共接口
     * @param sendEmail
     * @return
     */
    @PostMapping("sendEmail")
    public @ResponseBody
    R sendEmail(@RequestBody SendEmail sendEmail){
        return emailService.sendEmail(sendEmail);
    }

}
